CFWRAP -- Word Wrapping Tuned for CompuServe(R) Capture Files Copyright (c) 1994 by David M. Wincelberg Table of Contents I. Introduction .................................................. 1 II. License Agreement ............................................. 2 III. Suggestions for Use ........................................... 2 IV. Suitable Tasks for CFWRAP, With Instructions .................. 3 Appendices: A. Command line switches ......................................... 4 B. Initialization (.INI) file .................................... 4 C. Troubleshooting ............................................... 6 D. Recognized Paragraph Types .................................... 7 E. Definitions ................................................... 7 I. Introduction Thank you for trying CFWRAP. This program prepares CompuServe capture files for editing by removing page pause lines and word-wrapping various types of paragraphs. A sample such line is "Press for more !" Many of these lines are in a user-changeable .INI file. Recognized paragraph types include each line starting with ">>" and long file descriptions. A safety feature of this program is its exclusion of files with user-specified extensions. Thus, one can use wildcards and include subdirectories without ruining .EXE and .ZIP files. If you run CFWRAP on this file (CFWRAP.TXT), you will notice that the table of contents is distorted. The reason is that it looks like an ordinary paragraph to CFWRAP. It is not included as a recognized paragraph type since a table of contents in that form is not likely to be printed by a bulletin board. If you find an example where this does appear on a bulletin board, please send me a capture file containing it by CompuServe (not Internet) e-mail to 71573,1023. If you decide to keep this program after 30 days, you are required to pay the $15 license and registration fee in order to use this program legally, receive technical support and be notified of updates and bug fixes. Otherwise, you may NOT keep the individual files on your PC but you may keep the .ZIP file. A registration form is in the file CFWRAP.REG. Make your check or money order for $15 payable to David Wincelberg and mail it to David Wincelberg FileJockey Software 289 S. Robertson Blvd., #373 Beverly Hills, CA 90211 Please send comments, suggestions and problem reports to me at 71573,1023 by CompuServe (not Internet) e-mail or at the above postal address. I plan to read each one, but, if I receive a large amount of mail, I may not be able to reply to each letter. You may share this program with others, but do not charge more than $5 for floppies or $40 for CD-ROMs. In addition, you must inform the recipient(s) that the amount you are charging, if any, does not include the license and registration fee. Please include the original initialization (.INI) and documentation files along with the program. This product is not available directly from me. It is only available from bulletin boards, friends, shareware distributors, etc. CFWRAP requires DOS 2.1 or higher. Although some program functions require a higher DOS version, these functions may be bypassed or will ask you for assistance. See the troubleshooting guide for further information. II. License Agreement This is a legal agreement between you ("Licensee") and FileJockey Software ("Licensor"). Licensor owns all worldwide rights, title, copyright and other interests in and to the computer program identified as CFWRAP 1.0 ("Software"). By using the Software, you are agreeing to be bound by the following terms: 1. Licensor grants to Licensee the non-exclusive and non-assignable right to use the Software for a period of 30 days without paying a fee to Licensor. After 30 days, Licensee may continue this right by paying $15 to Licensor. 2. Licensee may distribute copies of the Software and related files to others provided Licensee informs the recipients that the Software is subject to a license agreement and that the fee you charge, if any, does not include the $15 license fee. 3. Licensor hereby alerts Licensee that the Software, accompanying documentation, and the initialization (.INI) file are provided "AS IS" without warranty of any kind. Licensor assumes all risks involving use of the Software and its results and performance. 4. Licensee hereby acknowledges that Licensor bears no responsibility or liability which may arise or result from Licensee's use of the Software. Licensee hereby waives and releases Licensor from any and all claims for damages, losses and costs therefrom. In no event shall Licensor's liability for any damages ever exceed the price paid for license and registration, regardless of the form of the claim. 5. This license agreement shall be construed and enforced in accordance with the laws of the State of California. This agreement may not be modified except by written instrument signed by both parties. If any provisions of this agreement are found to be invalid or unenforceable by the operation of the law, then invalidity or unenforceability of such provision(s) shall not affect the validity or enforceability of the other provisions of this agreement. Any dispute arising from this agreement shall be submitted to California courts located in Los Angeles County, and Licensee hereby submits to the jurisdiction of such courts. III. Suggestions for Use Let the program save original files with the BAK extension. This is the default setting. It is a good idea to review new files before deleting original ones since unrecognized paragraph types might not be handled properly. If you find a paragraph type that should be handled, please e-mail me a sample with a brief description of what it is and what forum or command generated it. Review the list of file extensions in the [Exclude] section of CFWRAP.INI. CFWRAP will skip files with these extensions. If the list is OK, then you may wish to process groups of files and include sub-directories. IV. Suitable Tasks for CFWRAP, With Instructions A. Prepare a CompuServe capture file for editing This is the main purpose of CFWRAP. The simplest use is: CFWRAP filename where filename is the name of a capture file. The program removes page pause lines and word-wraps the remainder of the file while connecting paragraphs split by pause lines. B. Remove page pause (or other designated) lines This is one of the main aspects of CFWRAP. The lines that are removed are defined in CFWRAP.INI. These lines do not have to be pause lines. They can be any lines up to about 65 characters not containing semicolons. (But you may change the data separator character. See Appendix B.) As above, run the program with: CFWRAP filename C. Word wrap This is the other main aspect of CFWRAP. It is invoked by CFWRAP /nn filename where /nn is an optional parameter to override the maximum line length specified in CFWRAP.INI. An example is: CFWRAP /45 file_id.diz There is also a parameter MinWrapStartLength in CFWRAP.INI, with a default value of 60, which specifies when a line is long enough to start word wrapping. For example, you may wish to word-wrap a paragraph even though the first line does not exceed the maximum line length. CFWRAP breaks or connects hyphenated words when appropriate for word wrapping. D. Right justify text Enter: CFWRAP /J filename Only lines in a paragraph that is word-wrapped will be justified, except for its last line. E. Process groups of file safely As noted above, CFWRAP will not process files whose extensions are on any of the lists of the [Exclude] section of CFWRAP.INI. These lists are grouped by program type to make it easier for you to check that you are excluding the extensions for your applications. As a result, you don't have to worry about accidentally changing files that have ZIP, EXE or many other common binary formats. Thus, you can enter: CFWRAP /S *.* to clean and word-wrap all suitable files in the current directory and any subdirectories. In addition, you can restrict the program to operate on files from a specified date by adding /D:mm-dd-yy to the options and you can instruct the program to ask before cleaning each file using /P: CFWRAP /S /D:8-1-94 /P *.* By default, the program makes a backup of all files that are changed. As a result, you can recover any file that is not processed to your satisfaction. F. Count long lines without changing the files Enter: CFWRAP /C filename(s) This is useful for checking that lines will not be wrapped when files, such those containing program source code, are brought into a word processor for printing. G. Prepare text files for use in a word processor Enter: CFWRAP /U filename(s) Alternatively, you could set MinWrapStartLength low (such as 5) and MaxLineLength high (such as 10000) in the [General] section of CFWRAP.INI. Note that some word processors have an input text reformatting feature. H. Process files captured from other on-line services To do so, you must customize CFWRAP.INI. See below for descriptions of the parts of the .INI file. (It is suggested that you save the original version in case you decide to share the program.) Appendices A. Command line switches Entering CFWRAP by itself or CFWRAP /? produces the following summary of command line switches (called options). Examples of using CFWRAP are given in section IV above. Switches apply to all specified files and may precede or follow filenames. Clean up and word-wrap capture files Usage: CFWRAP [options] file1 ... /nn Line limit in characters (default is 75) /S Look for matching file names also in subdirectories /D:mm-dd-yy Operate on files from date mm-dd-yy /B Save original files with extension changed to BAK /B- Don't save original files /P Prompt for confirmation before cleaning each file /J Right justify paragraph lines /C Count, but don't modify lines longer than limit /U Unwrap: prepare file(s) for use by a word processor file1 ... File(s) to be cleaned up (wildcards OK) Most of these options are self-explanatory. The back up name of a file is its base name with its extension changed to BAK. If a file with this name exists, the program will append numbers to the base name or increment a number found at the end of the base name until it finds an available name or gives up after trying up to ten million possibilities. In some cases, the program will replace letters of the base name, beyond the first one, with numbers. B. Initialization (.INI) file The program looks for CFWRAP.INI in the directory containing CFWRAP.EXE or in the root directory of the current drive (for DOS 2.x and lower). This file is divided into sections with each section headed by a word in brackets. Following this are lines for data entries that consist of a word, an equal sign and data. The program does not allow spaces around the equal signs. Note that CFWRAP makes a backup copy of an .INI file and names it CFWRAP.BAK the first time the program detects it is being run from another computer. Following is a description of each data entry in each section. [General] SkipNewUser=off Set to "on" to skip the welcome message. VolCSerNo= Serial number for drive C. Used to detect running CFWRAP on a different computer. MaxLineLength=75 Maximum line length for output file. You can override it with the /nn switch MinWrapStartLength=60 Line length for starting word wrapping MaxAdjacentBlankLines=2 Maximum number of blank lines that may appear together ArraySize=1024 Maximum size of input lines (minus two). CFWRAP will ask you to increase it if it is too short. MinHangingIndent=16 (Hidden option) Minimum indent of second paragraph line for CFWRAP to recognize a hanging paragraph. TwoSpaceTest=on (Hidden option) Put two spaces after a sentence when word wrapping. SaveOriginal=on (Hidden option) Save original file with BAK extension SepChar=; (Hidden option) Data separator character used below. [PauseLines] FullLine=off When on, CFWRAP considers entire input lines for equality tests. Otherwise, a line matches if it starts with one of the Skip entries. Skip1, Skip2, etc. Page pause lines to remove. The format is "pause_line;b;f;p" where b is the number of preceding blank lines to skip, f is the number of following lines, not necessarily blank, to skip when the full input line matches this page pause line, and p is the number of lines to skip when only part of a input line matches all of this pause line. When p is not included, its value is set to f. Proper setting of these numbers allows for connecting paragraphs split by page pause lines. [Exclude] This section lists extensions to be used for excluding files from processing. The entry names should assist you in specifying all relevant extensions. There is no effect to putting an extension in the wrong group since all of them are mixed together by CFWRAP. [ParLeaders] This section lists non-space characters that may precede each line of a paragraph. The program will keep these characters at the beginning of lines. Do not include any spaces in the leaders. CFWRAP will match the number of spaces before leaders. A paragraph leader that is contained in another one must not precede it. Thus, ">" must not precede ">>". Leader1,Leader2, etc. Entries for specifying leaders. [ProgLineDetectChars] CFWRAP will attempt to exclude computer program lines from word wrapping. AtStart=#/ Non-blank characters at the beginning of lines. AtEnd=;/){\ Non-blank characters at the end of lines. Numbers=off Should detect numbered Fortran lines FTComments=off Should detect Fortran comment lines -- lines starting with a C or D followed by a space C. Troubleshooting Repeated welcome messages: Set "SkipNewUser=on" in the [General] section of CFWRAP.INI. Although the new user detection routine requires DOS 4.0 or higher, it should work satisfactorily when it starts with the original CFWRAP.INI file and subsequently uses the updated file that it creates. The original CFWRAP.INI is saved as CFWRAP.BAK. Files skipped: Check if the file extensions are on any of the lists in the [Exclude] section of CFWRAP.INI. If so, rename the files or remove those extensions from the lists. Otherwise if the /D switch was used, check if the file dates are before the specified date. Out of memory: Finish any programs that you are running and try CFWRAP again. Directory errors: File read/write errors: Check if your disk is full or write protected. If not, use a disk utility to repair your disk. There are now such utilities in recent versions of DOS. For serious problems, you may wish to consider a third party product. Also, look in directory \CFWRAP#!.TMP for files that were processed but not yet moved to the source directory. You may need to reboot your computer before running other programs. Missing or can't find CFWRAP.INI: Chances are you are using DOS 2.x. In this case, the program cannot find where it is running from and looks for the .INI file on the root of the default directory. So, copy CFWRAP.INI to the root of each disk from which you will be running the program. CFWRAP does not work on some or all of my text file: If the bad part is small, use a text editor to copy the original of this part into the processed file. If the entire file is messed up and the extension is associated with a program, add that extension to the [Exclude] section of CFWRAP.INI. If the file is a CompuServe capture file and the segment in question is frequently generated by the service, please send a sample to 71573,1023 by CompuServe e-mail. D. Recognized Paragraph Types The types of paragraphs that CFWRAP can recognize and handle properly include indented paragraphs, hanging paragraphs, paragraphs separated by blank lines, user input lines, simple tables, long library listings and paragraphs in which each line starts with a defined leader. Some of these are described below. User input lines start with a number followed by a colon. An example of generating such lines is when one uses Compose to write a message. Simple tables start with a line of dashes and contain the vertical symbol (|) in each following line that does not start with dashes. The table is assumed to use no more than 80 columns. Long library listings start with the words "Title" and "Keywords" at the beginning of the first two lines and are followed by one or more paragraphs with a two space left margin. This format is used for long descriptions of files available for downloading. Some message writers use ">>" or ">" before each line in a message that is copied from a message the writer is responding to. Paragraphs that start with defined symbols can be word-wrapped while keeping the symbols at or near the left margin, depending how the symbols are used for that paragraph in the input file. As mentioned above, paragraph leaders are defined in the [ParLeaders] section of CFWRAP.INI and cannot be part of a leader that follows in this section. For example, ">" must not precede ">>." Hanging paragraphs are included so that running CFWRAP on this file only distorts the table of contents. A hanging paragraph is distinguished from an indented paragraph by requiring that the second line be indented at least 16 spaces and that the preceding line be blank or the end of another hanging paragraph. The required indent may be changed by adding the line "MinHangingIndent=nn" to the [General] section of CFWRAP.INI where nn is a whole number. E. Definitions Base name: The characters of a filename before the period, if any. There must be one to eight characters in the base name. Capture file: This is a record of what transpires during a bulletin board session. It consists of what you type and what the bulletin board computer types on your screen. Extension: The characters of a filename after the period, if any. The extension may consist of zero to three characters. Page pause line: This is a line inserted by the bulletin board computer to stop the output from scrolling off the screen before you can read it. It is also used to request user commands. Typically, it is preceded by one or more blank lines and is followed by several lines that remind you what service or function you are using. All (registered) trademarks and (registered) service marks are property of their respective companies.